﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DBLayer;
using System.Data;
using System.Data.SqlClient;

namespace BALayer
{
    public class DBThoiKhoaBieu
    {
        DAL db = null;
        public DBThoiKhoaBieu()
        {
            db = new DAL();
        }
        //Lay Thoi Khoa Bieu
        public DataSet LayThoiKhoaBieu()
        {
            return db.ExecuteQueryDataSet("Select * From ThoiKhoaBieu", CommandType.Text, null);
        }
        //Them Thoi Khoa Bieu
        public bool ThemThoiKhoaBieu(ref string err, string MaHS, string MaGV, string MaLop, string MaMH)
        {
            return db.MyExecuteNonQuery("SpThemThoiKhoaBieu", CommandType.StoredProcedure, ref err,
                new SqlParameter("@MaHS", MaHS),
                new SqlParameter("@MaGV", MaGV),
                new SqlParameter("@MaLop", MaLop),
                new SqlParameter("@MaMH", MaMH));
        }
        //Xoa Thoi Khoa Bieu
        public bool XoaThoiKhoaBieu(ref string err, string MaHS, string MaGV, string MaMH)
        {
            return db.MyExecuteNonQuery("SpXoaThoiKhoaBieu", CommandType.StoredProcedure, ref err,
                new SqlParameter("@MaHS", MaHS),
                new SqlParameter("@MaGV", MaGV),
                new SqlParameter("@MaMH", MaMH));
        }
        //Cap nhat Thoi Khoa Bieu
        public bool CapNhatThoiKhoaBieu(ref string err, string MaHS, string MaGV, string MaLop, string MaMH)
        {
            return db.MyExecuteNonQuery("SpCapNhatThoiKhoaBieu", CommandType.StoredProcedure, ref err,
                new SqlParameter("@MaHS", MaHS),
                new SqlParameter("@MaGV", MaGV),
                new SqlParameter("@MaLop", MaLop),
                new SqlParameter("@MaMH", MaMH));
        }
    }
}
